package com.atguigu.mybatisplus.controller;

import com.atguigu.mybatisplus.entity.User;
import com.atguigu.mybatisplus.service.UserService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/user")
@CrossOrigin
public class UserController {
    @Resource
    private UserService userService;
    @GetMapping("/list")
    public List<User> list(){
        return userService.list();
    }
    @GetMapping("/saveOrUpdate")
    public boolean saveOrUpdate(User user){
        return userService.saveOrUpdate(user);
    }
}
